package org.budo.jedis.pool.factory;

import org.budo.jedis.pool.BudoJedisPool;
import org.springframework.beans.factory.FactoryBean;

import lombok.Getter;
import lombok.Setter;
import redis.clients.jedis.JedisPoolConfig;
import redis.clients.jedis.Protocol;

/**
 * @author lmw
 */
@Getter
@Setter
public abstract class AbstractBudoJedisPoolFactory implements FactoryBean<BudoJedisPool> {
    private JedisPoolConfig jedisPoolConfig;

    private String host;

    private String password;

    private int port = Protocol.DEFAULT_PORT;

    private int timeout = Protocol.DEFAULT_TIMEOUT;

    private int database = Protocol.DEFAULT_DATABASE;

    @Override
    public Class<?> getObjectType() {
        return BudoJedisPool.class;
    }

    @Override
    public boolean isSingleton() {
        return true;
    }
}